<?php
/**
 * RAI服务对象
 *
 * @version $Id: RaiService.php 312 2008-04-23 16:29:38Z iwind $
 * @package net.4kiki.rai.server
 * @since 0.0.3
 */
class RaiService {
	private $object;
	private $validators = array();
	private $className;
	
	/**
	 * 构造器
	 *
	 * @param string $className 类名
	 * @param string $arguments 构造对象使用的参数
	 */
	public function __construct($className, $arguments = array()) {
		$this->className = $className;
		$this->object = IObjectFactory::getSingleObject($className, $arguments);
	}
	
	/**
	 * 添加检验器
	 *
	 * @param RaiValidator $validator 检验器
	 */
	public function addValidator(RaiValidator $validator) {
		$this->validators[] = $validator;
	}
	
	/**
	 * 取得检验器列表
	 *
	 * @return array
	 */
	public function getValidators() {
		return $this->validators;
	}
	
	/**
	 * 取得服务对象
	 *
	 * @return object
	 */
	public function getObject() {
		return $this->object;
	}
	
	/**
	 * 取得类名称
	 *
	 * @return string
	 */
	public function getClassName() {
		return $this->className;
	}
}

?>